import { requestClient } from '#/api/request';

export namespace DesignerApi {
    export interface PageFetchParams {
      [key: string]: any;
      page: number;
      pageSize: number;
      search?: string;
  }


    export interface DesignerModel {
    id: string;
    name: string;
    redirect: string;
    tableName: string;
    layout: string;
    description: string;
    createBy?: string;
    updateBy?: string;
    createTimeFormat?: string;
    updateTimeFormat?: string;
    }


    export interface DesignerParams {
    page: number;
    pageSize: number;
    search?: string;
    }
}
export function saveDesignerApi(data: Record<string, any>) {
  return requestClient.post<DesignerApi.DesignerParams>('/lowcode/designer/save', data);
}

export function getDesignerApi(params: DesignerApi.DesignerParams) {
  return requestClient.get('/lowcode/designer/list', { params });
}

export function deleteDesignerApi(id: number | string) {
  return requestClient.delete('/lowcode/designer/delete', { params: { id } });
}
